home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 22
/
Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso
/
Aminet
/
dev
/
amos
/
APro_GadTools.lha
/
GadTools
/
GadTools.Inc
/
GadTools.amosSourceCode
Wrap
AMOS Source Code
|
1995-10-09
|
22KB
|
801 lines
' _PushButton[Id,X,Y,Color1,Color2,Color3,Color4,"Button-Name"]
' _Del_PushButton[Id]
' _CheckBox[Id,X,Y,Color1,Color2,Color3,Color4,On/Off]
' _Set_CheckBox_State[Id,On/Off]
' _Get_CheckBox_State[Id]
' _Del_CheckBox[Id]
' _RadioButton[Id,X,Y,Color1,Color2,Color3,On/Off]
' _Set_RadioButton_State[Id,On/Off]
' _Get_RadioButton_State[Id]
' _Del_RadioButton[Id]
' _CycleButton[Id,X,Y,Color1,Color2,Color3,Color4,"Text1|Text2..."]
' _Set_CycleButton_State[Id,TextNumber]
' _Get_CycleButton_State[Id]
' _Del_CycleButton[Id]
' _ToggleButton[Id,X,Y,Color1,Color2,Color3,Color4,On/Off,"Button-Name"]
' _Set_ToggleButton_State[Id,On/Off]
' _Get_ToggleButton_State[Id]
' _Del_ToggleButton[Id]
' _StringGadget[Id,X,Y,Color1,Color2,Color3,Color4,Color5,GadLen,MaxTextLen]
' _Set_StringGadget_State[Id,String$]
' _Get_StringGadget_State[Id]
' _Del_StringGadget[Id]
' _TextGadget[Id,X,Y,Color1,Color2,Color3,Color4,MaxTextLen]
' _Set_TextGadget_Text[Id,String$]
' _Make_Mask[X1,Y1,X2,Y2,Color1,Color2,Color3]
' _Screen_Open[Screen,0-2 {Lores/Hires/Interlace} ]
Procedure _PUSHBUTTON[Z,X,Y,A,B,C,D,A$]
'
' Button aufbauen!
'
If Z<1 or Z>30 Then Pop Proc
F=Len(A$) : E=Screen Mode
If E<>0 and X/2*2<>X Then Inc X
Cls A,X,Y To X+F*8+5,Y+13
Cls B,X+1,Y+1 To X+1+F*8+5,Y+13
Cls C,X+1,Y+1 To X+1+F*8+4,Y+12
Ink D,C : Text X+3,Y+9,A$
'
' Daten zum Button in Bank sichern!
'
Reserve As Work 500+Z,20 : Rem <------- Ab Bank 501 = Button 1
Doke Start(500+Z)+0,X : Rem <------- Word.W = Min X Mouse
Doke Start(500+Z)+2,X+F*8+5 : Rem <------- Word.W = Max X Mouse
Doke Start(500+Z)+4,Y : Rem <------- Word.W = Min Y Mouse
Doke Start(500+Z)+6,Y+12 : Rem <------- Word.W = Max Y Mouse
Doke Start(500+Z)+8,X : Rem <------- Word.W = X Coords.
Doke Start(500+Z)+10,Y : Rem <------- Word.W = Y Coords.
Poke Start(500+Z)+12,A : Rem <------- Byte.B = 1.Farbe
Poke Start(500+Z)+13,B : Rem <------- Byte.B = 2.Farbe
Poke Start(500+Z)+14,F : Rem <------- Byte.B = Text-L�nge!
If Length(531)=0 Then Reserve As Work 531,35
A=Hunt(Start(531) To Start(531)+Length(531),Chr$(0))
If Hunt(Start(531) To Start(531)+Length(531),Chr$(Z))=0 Then Poke A,Z
End Proc
Procedure _PUSHBUTTON_HIT
If Length(531)=0 Then Pop Proc[0]
I=0
Do
Z=Peek(Start(531)+I)+500
Inc I
Exit If Z=500
A=Deek(Start(Z)+0) : B=Deek(Start(Z)+2)
C=Deek(Start(Z)+4) : D=Deek(Start(Z)+6)
If X Screen(X Mouse)>A and X Screen(X Mouse)<B and Y Screen(Y Mouse)>C and Y Screen(Y Mouse)<D and Mouse Key=1
X=Deek(Start(Z)+8) : Y=Deek(Start(Z)+10)
A=Peek(Start(Z)+12) : B=Peek(Start(Z)+13)
F=Peek(Start(Z)+14)
Ink A,B
Draw X+1,Y+12 To X+F*8+5,Y+12
Draw X+F*8+5,Y+1 To X+F*8+5,Y+12
Ink B,A
Draw X,Y To X+F*8+4,Y
Draw X,Y To X,Y+12
Repeat : Until Mouse Key=0
Ink A,B
Draw X,Y To X+F*8+4,Y
Draw X,Y To X,Y+12
Ink B,A
Draw X+1,Y+12 To X+F*8+5,Y+12
Draw X+F*8+5,Y+1 To X+F*8+5,Y+12
Pop Proc[Z-500]
End If
Loop
End Proc[0]
Procedure _DEL_PUSHBUTTON[A]
If A<1 or A>30 or Length(500+A)=0 Then Pop Proc
A$=Peek$(Start(531),30,Chr$(0))
A$=A$-Chr$(A) : Poke$ Start(531),A$+Chr$(0)
If A$="" Then Erase 531
Erase 500+A
End Proc
Procedure _CHECKBOX[Z,X,Y,A,B,C,D,E]
'
' Box aufbauen!
'
If Z<1 or Z>30 Then Pop Proc
F=Screen Mode
If F<>0 and X/2*2<>X Then Inc X
If E<0 Then E=0
If E>1 Then E=1
Cls A,X,Y To X+21,Y+13
Cls B,X+1,Y+1 To X+22,Y+13
Cls C,X+1,Y+1 To X+21,Y+12
If E=1
Ink D,C
Draw X+6,Y+6 To X+9,Y+9
Draw X+9,Y+9 To X+15,Y+3
Draw X+7,Y+6 To X+10,Y+9
Draw X+10,Y+9 To X+16,Y+3
End If
'
' Daten zum Button in Bank sichern!
'
Reserve As Work 600+Z,20 : Rem <------- Ab Bank 601 = Box 1
Doke Start(600+Z)+0,X : Rem <------- Word.W = Min X Mouse
Doke Start(600+Z)+2,X+21 : Rem <------- Word.W = Max X Mouse
Doke Start(600+Z)+4,Y : Rem <------- Word.W = Min Y Mouse
Doke Start(600+Z)+6,Y+12 : Rem <------- Word.W = Max Y Mouse
Doke Start(600+Z)+8,X : Rem <------- Word.W = X Coords.
Doke Start(600+Z)+10,Y : Rem <------- Word.W = Y Coords.
Poke Start(600+Z)+12,A : Rem <------- Byte.B = 1.Farbe
Poke Start(600+Z)+13,B : Rem <------- Byte.B = 2.Farbe
Poke Start(600+Z)+14,C : Rem <------- Byte.B = 3.Farbe
Poke Start(600+Z)+15,D : Rem <------- Byte.B = 4.Farbe
Poke Start(600+Z)+16,E : Rem <------- Byte.B = On/Off
If Length(631)=0 Then Reserve As Work 631,35
A=Hunt(Start(631) To Start(631)+Length(631),Chr$(0))
If Hunt(Start(631) To Start(631)+Length(631),Chr$(Z))=0 Then Poke A,Z
End Proc
Procedure _CHECKBOX_HIT
If Length(631)=0 Then Pop Proc[0]
I=0 : F=0
Do
Z=Peek(Start(631)+I)+600
Inc I
Exit If Z=600
A=Deek(Start(Z)+0) : B=Deek(Start(Z)+2)
C=Deek(Start(Z)+4) : D=Deek(Start(Z)+6)
If X Screen(X Mouse)>A and X Screen(X Mouse)<B and Y Screen(Y Mouse)>C and Y Screen(Y Mouse)<D and Mouse Key=1 Then F=1
If F=1
X=Deek(Start(Z)+8) : Y=Deek(Start(Z)+10)
A=Peek(Start(Z)+12) : B=Peek(Start(Z)+13)
C=Peek(Start(Z)+14) : D=Peek(Start(Z)+15)
E=Peek(Start(Z)+16)
End If
If F=1 and E=1
Ink C,D
Draw X+6,Y+6 To X+9,Y+9
Draw X+9,Y+9 To X+15,Y+3
Draw X+7,Y+6 To X+10,Y+9
Draw X+10,Y+9 To X+16,Y+3
Poke Start(Z)+16,0
Repeat : Until Mouse Key=0
Pop Proc[Z-600]
End If
If F=1 and E=0
Ink D,C
Draw X+6,Y+6 To X+9,Y+9
Draw X+9,Y+9 To X+15,Y+3
Draw X+7,Y+6 To X+10,Y+9
Draw X+10,Y+9 To X+16,Y+3
Poke Start(Z)+16,1
Repeat : Until Mouse Key=0
Pop Proc[Z-600]
End If
Loop
End Proc[0]
Procedure _SET_CHECKBOX_STATE[A,B]
If A<1 or A>30 Then Pop Proc
If Length(600+A)<>0
E=1
X=Deek(Start(600+A)+8) : Y=Deek(Start(600+A)+10)
C=Peek(Start(600+A)+14) : D=Peek(Start(600+A)+15)
End If
If E=1 and B=0
Ink C,D
Draw X+6,Y+6 To X+9,Y+9
Draw X+9,Y+9 To X+15,Y+3
Draw X+7,Y+6 To X+10,Y+9
Draw X+10,Y+9 To X+16,Y+3
Poke Start(600+A)+16,0
End If
If E=1 and B=1
Ink D,C
Draw X+6,Y+6 To X+9,Y+9
Draw X+9,Y+9 To X+15,Y+3
Draw X+7,Y+6 To X+10,Y+9
Draw X+10,Y+9 To X+16,Y+3
Poke Start(600+A)+16,1
End If
End Proc
Procedure _GET_CHECKBOX_STATE[A]
If A<1 or A>30 or Length(600+A)=0 Then Pop Proc[-1]
B=Peek(Start(600+A)+16)
End Proc[B]
Procedure _DEL_CHECKBOX[A]
If A<1 or A>30 or Length(600+A)=0 Then Pop Proc
A$=Peek$(Start(631),30,Chr$(0))
A$=A$-Chr$(A) : Poke$ Start(631),A$+Chr$(0)
If A$="" Then Erase 631
Erase 600+A
End Proc
Procedure _RADIOBUTTON[Z,X,Y,A,B,C,D]
'
' Box aufbauen!
'
If Z<1 or Z>30 Then Pop Proc
F=Screen Mode
If F<>0 and X/2*2<>X Then Inc X
If D<0 Then D=0
If D>1 Then D=1
Ink A,C
Ellipse X+12,Y+6,12,6
If D=0
Ink C,B
Bar X+7,Y+4 To X+17,Y+8
Draw X+9,Y+3 To X+15,Y+3
Draw X+9,Y+9 To X+15,Y+9
Draw X+6,Y+5 To X+6,Y+7
Draw X+18,Y+5 To X+18,Y+7
End If
If D=1
Ink B,C
Bar X+7,Y+4 To X+17,Y+8
Draw X+9,Y+3 To X+15,Y+3
Draw X+9,Y+9 To X+15,Y+9
Draw X+6,Y+5 To X+6,Y+7
Draw X+18,Y+5 To X+18,Y+7
End If
'
' Daten zum Button in Bank sichern!
'
Reserve As Work 700+Z,20 : Rem <------- Ab Bank 701 = Radio 1
Doke Start(700+Z)+0,X : Rem <------- Word.W = Min X Mouse
Doke Start(700+Z)+2,X+24 : Rem <------- Word.W = Max X Mouse
Doke Start(700+Z)+4,Y : Rem <------- Word.W = Min Y Mouse
Doke Start(700+Z)+6,Y+12 : Rem <------- Word.W = Max Y Mouse
Doke Start(700+Z)+8,X : Rem <------- Word.W = X Coords.
Doke Start(700+Z)+10,Y : Rem <------- Word.W = Y Coords.
Poke Start(700+Z)+12,A : Rem <------- Byte.B = 1.Farbe
Poke Start(700+Z)+13,B : Rem <------- Byte.B = 2.Farbe
Poke Start(700+Z)+14,C : Rem <------- Byte.B = 3.Farbe
Poke Start(700+Z)+15,D : Rem <------- Byte.B = On/Off
If Length(731)=0 Then Reserve As Work 731,35
A=Hunt(Start(731) To Start(731)+Length(731),Chr$(0))
If Hunt(Start(731) To Start(731)+Length(731),Chr$(Z))=0 Then Poke A,Z
End Proc
Procedure _RADIOBUTTON_HIT
If Length(731)=0 Then Pop Proc[0]
I=0 : F=0
Do
Z=Peek(Start(731)+I)+700
Inc I
Exit If Z=700
A=Deek(Start(Z)+0) : B=Deek(Start(Z)+2)
C=Deek(Start(Z)+4) : D=Deek(Start(Z)+6)
If X Screen(X Mouse)>A and X Screen(X Mouse)<B and Y Screen(Y Mouse)>C and Y Screen(Y Mouse)<D and Mouse Key=1 Then F=1
If F=1
X=Deek(Start(Z)+8) : Y=Deek(Start(Z)+10)
A=Peek(Start(Z)+12) : B=Peek(Start(Z)+13)
C=Peek(Start(Z)+14) : D=Peek(Start(Z)+15)
End If
If F=1 and D=1
Ink C,B
Bar X+7,Y+4 To X+17,Y+8
Draw X+9,Y+3 To X+15,Y+3
Draw X+9,Y+9 To X+15,Y+9
Draw X+6,Y+5 To X+6,Y+7
Draw X+18,Y+5 To X+18,Y+7
Poke Start(Z)+15,0
Repeat : Until Mouse Key=0
Pop Proc[Z-700]
End If
If F=1 and D=0
Ink B,C
Bar X+7,Y+4 To X+17,Y+8
Draw X+9,Y+3 To X+15,Y+3
Draw X+9,Y+9 To X+15,Y+9
Draw X+6,Y+5 To X+6,Y+7
Draw X+18,Y+5 To X+18,Y+7
Poke Start(Z)+15,1
Repeat : Until Mouse Key=0
Pop Proc[Z-700]
End If
Loop
End Proc[0]
Procedure _SET_RADIOBUTTON_STATE[A,B]
If A<1 or A>30 Then Pop Proc
If Length(700+A)<>0
E=1
X=Deek(Start(700+A)+8) : Y=Deek(Start(700+A)+10)
C=Peek(Start(700+A)+13) : D=Peek(Start(700+A)+14)
End If
If E=1 and B=0
Ink D,C
Bar X+7,Y+4 To X+17,Y+8
Draw X+9,Y+3 To X+15,Y+3
Draw X+9,Y+9 To X+15,Y+9
Draw X+6,Y+5 To X+6,Y+7
Draw X+18,Y+5 To X+18,Y+7
Poke Start(700+A)+15,0
End If
If E=1 and B=1
Ink C,D
Bar X+7,Y+4 To X+17,Y+8
Draw X+9,Y+3 To X+15,Y+3
Draw X+9,Y+9 To X+15,Y+9
Draw X+6,Y+5 To X+6,Y+7
Draw X+18,Y+5 To X+18,Y+7
Poke Start(700+A)+15,1
End If
End Proc
Procedure _GET_RADIOBUTTON_STATE[A]
If A<1 or A>30 or Length(700+A)=0 Then Pop Proc[-1]
B=Peek(Start(700+A)+15)
End Proc[B]
Procedure _DEL_RADIOBUTTON[A]
If A<1 or A>30 or Length(700+A)=0 Then Pop Proc
A$=Peek$(Start(731),30,Chr$(0))
A$=A$-Chr$(A) : Poke$ Start(731),A$+Chr$(0)
If A$="" Then Erase 731
Erase 700+A
End Proc
Procedure _CYCLEBUTTON[Z,X,Y,A,B,C,D,A$]
F=0 : G=0 : E=30
If Z<1 or Z>30 Then Pop Proc
If Right$(A$,1)<>"|" Then A$=A$+"|"
Reserve As Work 800+Z,Len(A$)+50 : Rem <------- Ab Bank 801 = Cycle 1
Poke$ Start(800+Z)+30,A$
B$=Peek$(Start(800+Z)+30,75,"|") : Rem <------- Ersten Name Merken
Repeat : Rem <------- L�ngsten Name ermitteln
C$=Peek$(Start(800+Z)+E,75,"|")
If Len(C$)>F Then F=Len(C$)
Add E,Len(C$)+1
Inc G
Until E=Len(A$)+30
'
' Gadget aufbauen!
'
E=Screen Mode
If E<>0 and X/2*2<>X Then Inc X
Cls A,X,Y To X+F*8+25,Y+13
Cls B,X+1,Y+1 To X+1+F*8+25,Y+13
Cls C,X+1,Y+1 To X+1+F*8+24,Y+12
Ink D,C : Text X+23,Y+9,B$
Ink B,C
Box X+5,Y+2 To X+14,Y+10
Box X+6,Y+2 To X+13,Y+10
Draw X+11,Y+5 To X+16,Y+5
Draw X+12,Y+6 To X+15,Y+6
Draw X+19,Y+2 To X+19,Y+10
Ink A,C
Draw X+20,Y+2 To X+20,Y+10
Ink C,A
Plot X+5,Y+2 : Plot X+5,Y+10
Plot X+14,Y+10 : Plot X+14,Y+2
Plot X+13,Y+8 : Plot X+14,Y+8
'
' Daten zum Button in Bank sichern!
'
Doke Start(800+Z)+0,X : Rem <------- Word.W = Min X Mouse
Doke Start(800+Z)+2,X+F*8+25 : Rem <------- Word.W = Max X Mouse
Doke Start(800+Z)+4,Y : Rem <------- Word.W = Min Y Mouse
Doke Start(800+Z)+6,Y+12 : Rem <------- Word.W = Max Y Mouse
Doke Start(800+Z)+8,X : Rem <------- Word.W = X Coords.
Doke Start(800+Z)+10,Y : Rem <------- Word.W = Y Coords.
Poke Start(800+Z)+12,A : Rem <------- Byte.B = 1.Farbe
Poke Start(800+Z)+13,B : Rem <------- Byte.B = 2.Farbe
Poke Start(800+Z)+14,C : Rem <------- Byte.B = 3.Farbe
Poke Start(800+Z)+15,D : Rem <------- Byte.B = 4.Farbe
Poke Start(800+Z)+16,G : Rem <------- Byte.B = Anzahl Texte!
Poke Start(800+Z)+17,1 : Rem <------- Byte.B = Aktueller Text!
Poke Start(800+Z)+18,F : Rem <------- Byte.B = L�ngster Text!
If Length(831)=0 Then Reserve As Work 831,35
A=Hunt(Start(831) To Start(831)+Length(831),Chr$(0))
If Hunt(Start(831) To Start(831)+Length(831),Chr$(Z))=0 Then Poke A,Z
End Proc
Procedure _CYCLEBUTTON_HIT
If Length(831)=0 Then Pop Proc[0]
I=0 : H=0
Do
Z=Peek(Start(831)+I)+800
Inc I
Exit If Z=800
A=Deek(Start(Z)+0) : B=Deek(Start(Z)+2)
C=Deek(Start(Z)+4) : D=Deek(Start(Z)+6)
If X Screen(X Mouse)>A and X Screen(X Mouse)<B and Y Screen(Y Mouse)>C and Y Screen(Y Mouse)<D and Mouse Key=1
X=Deek(Start(Z)+8) : Y=Deek(Start(Z)+10)
A=Peek(Start(Z)+12) : B=Peek(Start(Z)+13)
C=Peek(Start(Z)+14) : D=Peek(Start(Z)+15)
E=Peek(Start(Z)+16) : F=Peek(Start(Z)+17)
G=Peek(Start(Z)+18)
Ink A,B
Draw X+1,Y+12 To X+G*8+25,Y+12
Draw X+G*8+25,Y+1 To X+G*8+25,Y+12
Draw X+19,Y+2 To X+19,Y+10
Ink B,A
Draw X,Y To X+G*8+24,Y
Draw X,Y To X,Y+12
Draw X+20,Y+2 To X+20,Y+10
Repeat : Until Mouse Key=0
Ink A,B
Draw X,Y To X+G*8+24,Y
Draw X,Y To X,Y+12
Draw X+20,Y+2 To X+20,Y+10
Ink B,A
Draw X+1,Y+12 To X+G*8+25,Y+12
Draw X+G*8+25,Y+1 To X+G*8+25,Y+12
Draw X+19,Y+2 To X+19,Y+10
Add F,1,1 To E
Poke Start(Z)+17,F
For A=1 To F
A$=Peek$(Start(Z)+30+H,75,"|")
Add H,Len(A$)+1
Next A
Ink D,C
Text X+23,Y+9,Space$(G)
Text X+23,Y+9,A$
Pop Proc[Z-800]
End If
Loop
End Proc[0]
Procedure _SET_CYCLEBUTTON_STATE[A,B]
If A<1 or A>30 Then Pop Proc
If Length(800+A)<>0 Then If Peek(Start(800+A)+16)=>B Then E=1
If E=1
H=0
X=Deek(Start(800+A)+8) : Y=Deek(Start(800+A)+10)
C=Peek(Start(800+A)+14) : D=Peek(Start(800+A)+15)
G=Peek(Start(800+A)+18) : Poke Start(800+A)+17,B
For F=1 To B
A$=Peek$(Start(800+A)+30+H,75,"|")
Add H,Len(A$)+1
Next F
Ink D,C
Text X+23,Y+9,Space$(G)
Text X+23,Y+9,A$
End If
End Proc
Procedure _GET_CYCLEBUTTON_STATE[A]
If A<1 or A>30 or Length(800+A)=0 Then Pop Proc[-1]
B=Peek(Start(800+A)+17)
End Proc[B]
Procedure _DEL_CYCLEBUTTON[A]
If A<1 or A>30 or Length(800+A)=0 Then Pop Proc
A$=Peek$(Start(831),30,Chr$(0))
A$=A$-Chr$(A) : Poke$ Start(831),A$+Chr$(0)
If A$="" Then Erase 831
Erase 800+A
End Proc
Procedure _TOGGLEBUTTON[Z,X,Y,A,B,C,D,E,A$]
'
' Button aufbauen!
'
If Z<1 or Z>30 or E<0 or E>1 Then Pop Proc
F=Len(A$) : G=Screen Mode
If G<>0 and X/2*2<>X Then Inc X
If E=0
Cls A,X,Y To X+F*8+5,Y+13
Cls B,X+1,Y+1 To X+1+F*8+5,Y+13
Cls C,X+1,Y+1 To X+1+F*8+4,Y+12
Ink D,C : Text X+3,Y+9,A$
Else
Cls B,X,Y To X+F*8+5,Y+13
Cls A,X+1,Y+1 To X+1+F*8+5,Y+13
Cls C,X+1,Y+1 To X+1+F*8+4,Y+12
Ink D,C : Text X+3,Y+9,A$
End If
'
' Daten zum Button in Bank sichern!
'
Reserve As Work 900+Z,20 : Rem <------- Ab Bank 901 = Toggle 1
Doke Start(900+Z)+0,X : Rem <------- Word.W = Min X Mouse
Doke Start(900+Z)+2,X+F*8+5 : Rem <------- Word.W = Max X Mouse
Doke Start(900+Z)+4,Y : Rem <------- Word.W = Min Y Mouse
Doke Start(900+Z)+6,Y+12 : Rem <------- Word.W = Max Y Mouse
Doke Start(900+Z)+8,X : Rem <------- Word.W = X Coords.
Doke Start(900+Z)+10,Y : Rem <------- Word.W = Y Coords.
Poke Start(900+Z)+12,A : Rem <------- Byte.B = 1.Farbe
Poke Start(900+Z)+13,B : Rem <------- Byte.B = 2.Farbe
Poke Start(900+Z)+14,F : Rem <------- Byte.B = Text-L�nge!
Poke Start(900+Z)+15,E : Rem <------- Byte.B = On/Off
If Length(931)=0 Then Reserve As Work 931,35
A=Hunt(Start(931) To Start(931)+Length(931),Chr$(0))
If Hunt(Start(931) To Start(931)+Length(931),Chr$(Z))=0 Then Poke A,Z
End Proc
Procedure _TOGGLEBUTTON_HIT
If Length(931)=0 Then Pop Proc[0]
I=0 : F=0
Do
Z=Peek(Start(931)+I)+900
Inc I
Exit If Z=900
A=Deek(Start(Z)+0) : B=Deek(Start(Z)+2)
C=Deek(Start(Z)+4) : D=Deek(Start(Z)+6)
If X Screen(X Mouse)>A and X Screen(X Mouse)<B and Y Screen(Y Mouse)>C and Y Screen(Y Mouse)<D and Mouse Key=1 Then F=1
If F=1
X=Deek(Start(Z)+8) : Y=Deek(Start(Z)+10)
A=Peek(Start(Z)+12) : B=Peek(Start(Z)+13)
C=Peek(Start(Z)+14) : D=Peek(Start(Z)+15)
End If
If F=1 and D=0
Ink A,B
Draw X+1,Y+12 To X+C*8+5,Y+12
Draw X+C*8+5,Y+1 To X+C*8+5,Y+12
Ink B,A
Draw X,Y To X+C*8+4,Y
Draw X,Y To X,Y+12
Poke Start(Z)+15,1
Repeat : Until Mouse Key=0
Pop Proc[Z-900]
End If
If F=1 and D=1
Ink B,A
Draw X+1,Y+12 To X+C*8+5,Y+12
Draw X+C*8+5,Y+1 To X+C*8+5,Y+12
Ink A,B
Draw X,Y To X+C*8+4,Y
Draw X,Y To X,Y+12
Poke Start(Z)+15,0
Repeat : Until Mouse Key=0
Pop Proc[Z-900]
End If
Loop
End Proc[0]
Procedure _SET_TOGGLEBUTTON_STATE[A,B]
If A<1 or A>30 Then Pop Proc
If Length(900+A)<>0
E=1
X=Deek(Start(900+A)+8) : Y=Deek(Start(900+A)+10)
C=Peek(Start(900+A)+12) : D=Peek(Start(900+A)+13)
F=Peek(Start(900+A)+14)
End If
If E=1 and B=0
Ink D,C
Draw X+1,Y+12 To X+F*8+5,Y+12
Draw X+F*8+5,Y+1 To X+F*8+5,Y+12
Ink C,D
Draw X,Y To X+F*8+4,Y
Draw X,Y To X,Y+12
Poke Start(900+A)+15,0
End If
If E=1 and B=1
Ink C,D
Draw X+1,Y+12 To X+F*8+5,Y+12
Draw X+F*8+5,Y+1 To X+F*8+5,Y+12
Ink D,C
Draw X,Y To X+F*8+4,Y
Draw X,Y To X,Y+12
Poke Start(900+A)+15,1
End If
End Proc
Procedure _GET_TOGGLEBUTTON_STATE[A]
If A<1 or A>30 or Length(900+A)=0 Then Pop Proc[-1]
B=Peek(Start(900+A)+15)
End Proc[B]
Procedure _DEL_TOGGLEBUTTON[A]
If A<1 or A>30 or Length(900+A)=0 Then Pop Proc
A$=Peek$(Start(931),30,Chr$(0))
A$=A$-Chr$(A) : Poke$ Start(931),A$+Chr$(0)
If A$="" Then Erase 931
Erase 900+A
End Proc
Procedure _STRINGGADGET[Z,X,Y,A,B,C,D,E,F,G]
'
' StringGadget aufbauen!
'
If Z<1 or Z>30 Then Pop Proc
H=Screen Mode
If H<>0 and X/2*2<>X Then Inc X
Cls A,X,Y To X+F*8+4,Y+11
Cls B,X+1,Y+1 To X+1+F*8+4,Y+11
Cls C,X+1,Y+1 To X+1+F*8+3,Y+10
'
' Daten zum StringGadget in Bank sichern!
'
Reserve As Work 1000+Z,G+50 : Rem <------- Ab Bank 1001 = Gadget 1
Doke Start(1000+Z)+0,X : Rem <------- Word.W = Min X Mouse
Doke Start(1000+Z)+2,X+F*8+5 : Rem <------- Word.W = Max X Mouse
Doke Start(1000+Z)+4,Y : Rem <------- Word.W = Min Y Mouse
Doke Start(1000+Z)+6,Y+10 : Rem <------- Word.W = Max Y Mouse
Doke Start(1000+Z)+8,X : Rem <------- Word.W = X Coords.
Doke Start(1000+Z)+10,Y : Rem <------- Word.W = Y Coords.
Poke Start(1000+Z)+12,C : Rem <------- Byte.B = GadGetFarbe
Poke Start(1000+Z)+13,D : Rem <------- Byte.B = TextFarbe
Poke Start(1000+Z)+14,E : Rem <------- Byte.B = CursorFarbe
Poke Start(1000+Z)+15,F : Rem <------- Byte.B = GadLen
Poke Start(1000+Z)+16,G : Rem <------- Byte.B = MaxTextLen
Poke$ Start(1000+Z)+20,Chr$(10) : Rem <------- Zu beginn LeerString
If Length(1031)=0 Then Reserve As Work 1031,35
A=Hunt(Start(1031) To Start(1031)+Length(1031),Chr$(0))
If Hunt(Start(1031) To Start(1031)+Length(1031),Chr$(Z))=0 Then Poke A,Z
End Proc
Procedure _STRINGGADGET_HIT
If Length(1031)=0 Then Pop Proc[0]
I=0 : F=0
Do
Z=Peek(Start(1031)+I)+1000
Inc I
Exit If Z=1000 or F<>0
A=Deek(Start(Z)+0) : B=Deek(Start(Z)+2)
C=Deek(Start(Z)+4) : D=Deek(Start(Z)+6)
If X Screen(X Mouse)>A and X Screen(X Mouse)<B and Y Screen(Y Mouse)>C and Y Screen(Y Mouse)<D and Mouse Key=1
F=1
Exit 1
End If
Loop
If F=0 Then Pop Proc[0]
X=Deek(Start(Z)+8) : Y=Deek(Start(Z)+10)
A=Peek(Start(Z)+12) : B=Peek(Start(Z)+13)
C=Peek(Start(Z)+14) : D=Peek(Start(Z)+15)
E=Peek(Start(Z)+16) : B$=Peek$(Start(Z)+20,E,Chr$(10))
Ink B,A
Text X+3,Y+8,Right$(B$,D-1)
Ink B,C
Text X+3+Len(Right$(B$,D-1))*8,Y+8," "
Repeat : Until Mouse Key=0
Clear Key
Do
A$=Inkey$
Exit If A$=Chr$(13) or Mouse Key=1
If A$=Chr$(8) and B$<>""
Ink B,A
Text X+3,Y+8,Right$(B$,D-1)+" "
A$=Left$(B$,Len(B$)-1)
B$=A$ : A$=""
End If
If Len(B$)<>E and A$<>Chr$(8) Then B$=B$+A$
If Upper$(A$)="X" and Key Shift=128
Ink B,A : Text X+3,Y+8,Space$(D) : B$=""
End If
Ink B,A
Text X+3,Y+8,Right$(B$,D-1)
Ink B,C
Text X+3+Len(Right$(B$,D-1))*8,Y+8," "
Loop
Ink B,A
Text X+3+Len(Right$(B$,D-1))*8,Y+8," "
Poke$ Start(Z)+20,B$+Chr$(10)
End Proc[Z-1000]
Procedure _SET_STRINGGADGET_STATE[A,A$]
If A<1 or A>30 Then Pop Proc
If Length(1000+A)<>0
E=1
X=Deek(Start(1000+A)+8) : Y=Deek(Start(1000+A)+10)
C=Peek(Start(1000+A)+12) : D=Peek(Start(1000+A)+13)
E=Peek(Start(1000+A)+15) : F=Peek(Start(1000+A)+16)
Ink D,C : Text X+3,Y+8,Left$(A$,E)
Poke$ Start(1000+A)+20,Left$(A$,F)+Chr$(10)
End If
End Proc
Procedure _GET_STRINGGADGET_STATE[A]
If A<1 or A>30 or Length(1000+A)=0 Then Pop Proc[-1]
B=Peek(Start(1000+A)+16)
A$=Peek$(Start(1000+A)+20,B,Chr$(10))
End Proc[A$]
Procedure _DEL_STRINGGADGET[A]
If A<1 or A>30 or Length(1000+A)=0 Then Pop Proc
A$=Peek$(Start(1031),30,Chr$(0))
A$=A$-Chr$(A) : Poke$ Start(1031),A$+Chr$(0)
If A$="" Then Erase 1031
Erase 1000+A
End Proc
Procedure _TEXTGADGET[Z,X,Y,A,B,C,D,E]
'
' TextGadget aufbauen!
'
If Z<1 or Z>30 Then Pop Proc
F=Screen Mode
If F<>0 and X/2*2<>X Then Inc X
Cls A,X,Y To X+E*8+5,Y+11
Cls B,X+1,Y+1 To X+1+E*8+5,Y+11
Cls C,X+1,Y+1 To X+1+E*8+4,Y+10
'
' Daten zum TextGadget in Bank sichern!
'
Reserve As Work 1100+Z,20 : Rem <------- Ab Bank 1101 = Gadget 1
Doke Start(1100+Z)+0,X : Rem <------- Word.W = X Coords.
Doke Start(1100+Z)+2,Y : Rem <------- Word.W = Y Coords.
Poke Start(1100+Z)+4,C : Rem <------- Byte.B = GadgetFarbe
Poke Start(1100+Z)+5,D : Rem <------- Byte.B = TextFarbe
Poke Start(1100+Z)+6,E : Rem <------- Byte.B = MaxText-L�nge!
End Proc
Procedure _SET_TEXTGADGET_TEXT[A,A$]
If A<1 or A>30 or Length(1100+A)=0 Then Pop Proc
X=Deek(Start(1100+A)+0) : Y=Deek(Start(1100+A)+2)
C=Peek(Start(1100+A)+4) : D=Peek(Start(1100+A)+5)
E=Peek(Start(1100+A)+6)
Ink D,C
Text X+3,Y+8,Space$(E)
Text X+3,Y+8,Left$(A$,E)
End Proc
Procedure _MAKE_MASK[X,Y,A,B,C,D,E]
Cls C,X,Y To A,B
Cls D,X+1,Y+1 To A,B
Cls E,X+1,Y+1 To A-1,B-1
End Proc
Procedure _SCREEN_OPEN[A,B]
If A<0 or A>7 or B<0 or B>2 Then Pop Proc
If B=0 Then Screen Open A,320,256,4,Lowres
If B=1 Then Screen Open A,640,256,4,Hires
If B=2 Then Screen Open A,640,512,4,Laced
Flash Off : Cls 0
Palette $AAA,$0,$FFF,$68B
End Proc